std::basic_istream::readsome

From Cppreference

Jump to: navigation, search
​basic_istream& readsome( char_type* s, streamsize count );

Extracts immediately available characters from the input stream.

If ​good() != true, ​setstate(failbit) is called and the function returns. At most count characters are extracted. If end-of-file is encountered earlier, ​setstate(eofbit​ is called and the function returns.

Function uses ​rdbuf()->in_avail() to determine how many characters are available for extraction. Note, that using this function with standard input does not guarantee that the function will not block.

Contents

Parameters

s - pointer to the character string to store the characters to
count - maximum number of characters to read

Return value

*this​

Example

See also

read
extracts blocks of characters
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages